home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sun4c
/
archive
/
tcltk.z
/
tcltk
/
man
/
cat3
/
PrintDbl.3
< prev
next >
Wrap
Text File
|
1994-09-20
|
2KB
|
67 lines
Tcl_PrintDouble(3) Tcl Library Procedures 7.0
_________________________________________________________________
NAME
Tcl_PrintDouble - Convert floating value to string
SYNOPSIS
#include <tcl.h>
Tcl_PrintDouble(_i_n_t_e_r_p, _v_a_l_u_e, _d_s_t)
ARGUMENTS
Tcl_Interp *_i_n_t_e_r_p (in) Interpreter that controls
the conversion.
double _v_a_l_u_e (in) Floating-point value to be
converted.
char *_d_s_t (out) Where to store string
representing _v_a_l_u_e. Must
have at least
TCL_DOUBLE_SPACE characters
of storage.
_________________________________________________________________
DESCRIPTION
Tcl_PrintDouble generates a string that represents the value
of _v_a_l_u_e and stores it in memory at the location given by
_d_s_t. It uses %g format to generate the string, with two
special twists. First, the string is guaranteed to contain
either a ``.'' or an ``e'' so that it doesn't look like an
integer (where %g would generate an integer with no decimal
point, Tcl_PrintDouble adds ``.0''). Second, the number of
significant digits printed at _d_s_t is controlled by the
tcl_precision variable in _i_n_t_e_r_p; if tcl_precision is unde-
fined then 6 significant digits are printed.
KEYWORDS
conversion, double-precision, floating-point, string
Tcl 1